package com.xh.jf_blog.mapper;

import com.xh.jf_blog.bean.Article;
import com.xh.jf_blog.bean.ArticleLike;
import com.xh.jf_blog.bean.Userinfo;

import java.util.ArrayList;
import java.util.List;

public interface ArticleLikeMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(ArticleLike record);

    int insertSelective(ArticleLike record);

    ArticleLike selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(ArticleLike record);

    int updateByPrimaryKey(ArticleLike record);

    /*查看作者被关注人数*/
    List<ArticleLike> getFollowByVip(int userinfoId);

    /*查看会员关注的作者人数*/
    List<ArticleLike> getFollowByAuthor(int userinfoId);

    /*参数为被关注编号*/
    List<ArticleLike> getLikeByArticle(int articleId);

    /*参数为关注者编号*/
    List<ArticleLike> getLikeByAuthor(int userinfoId);

    /*参数为被关注编号*/
    List<ArticleLike> getCollectionByArticle(int articleId);

    /*参数为关注者编号*/
    List<ArticleLike> getCollectionByAuthor(int userinfoId);

    int deleteLike(ArticleLike articleLike);

    List<ArticleLike> getAll(ArticleLike articleLike);

    /*查看指定文章的点赞人员列表*/
    List<Userinfo> getLikeListByArticleId(int articleId);

    /*查看指定文章的收藏人员列表*/
    List<Userinfo> getCollectionListByArticleId(int articleId);

    /*查看指定作者的关注人员列表*/
    List<Userinfo> getFollowListByUserinfoId(int userinfoId);

    /*查找指定用户的点赞文章列表*/
    List<Article> getLikedListByUserinfoId(int userinfoId);

    List<Article> getCollectionedListByUserinfoId(int userinfoId);

    List<Userinfo> getFollowedListByUserinfoId(int userinfoId);


    int deleteLikeByArticleId(int articleId);

    int deleteCollectionByArticleId(int articleId);

    int deleteFollowByUserinfoId(int userinfoId);

    int deleteByOptId(int userinfoId);
}
